home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / dpingw / dpingw.exe / DPing.vbs < prev    next >
Encoding:
Text File  |  1998-08-19  |  1.0 KB  |  33 lines

  1. L_Welcome_MsgBox_Message_Text    = "This script demonstrates DameWare Ping using the Windows Scripting Host."
  2. L_Welcome_MsgBox_Title_Text      = "DameWare Windows Scripting Host Sample"
  3. Call Welcome()
  4.  
  5. Dim DCtl1, strHostName
  6.  
  7. Set DCtl1 = Wscript.CreateObject("DameWare.DPingCtl.1")
  8.  
  9. strHostName = InputBox("Enter HostName to Ping (i.e. yahoo.com): ",L_Welcome_MsgBox_Title_Text)
  10.  
  11. If strHostName = "" Then
  12.     WScript.Echo "Invalid Host Name - please try again"
  13.     WScript.Quit
  14. Else
  15.     DCtl1.Ping strHostName
  16.     dummy =  MsgBox("HostName [" & strHostName & "] IP Address [" & DCtl1.IPAddress & _
  17.         "] pinged..." , _
  18.                       vbOKOnly + vbInformation,    _
  19.                       L_Welcome_MsgBox_Title_Text )
  20. End If
  21.  
  22. Set DCtl1 = Nothing
  23.  
  24. Sub Welcome()
  25.     Dim intDoIt
  26.  
  27.     intDoIt =  MsgBox(L_Welcome_MsgBox_Message_Text, _
  28.                       vbOKCancel + vbInformation,    _
  29.                       L_Welcome_MsgBox_Title_Text )
  30.     If intDoIt = vbCancel Then
  31.         WScript.Quit
  32.     End If
  33. End Sub